#include<bits/stdc++.h>
using namespace std;
int n , m;
const int maxn = 1001;
char a[maxn][maxn];
int vis[maxn][maxn];
int d[4][2] = {{0 , 1} , {0 , -1} , {-1 , 0} , {1 , 0}};
struct node{
	int x , y;
	int step;
}q[maxn];
void bfs(int sx , int sy , int ex , int ey){
	int head = 1 , tail = 1;
	q[tail].x = sx;
	q[tail].y = sy;
	q[tail].step = 1;
	tail++;
	vis[sx][sy] = 1;
	while(head < tail){
		int x0 = q[head].x;
		int y0 = q[head].y;
		int step = q[head].step;
		if(x0 == ex && y0 == ey){
			cout << "Yes" << endl;
			return;
		}
		for(int i = 0 ; i < 4 ; i++){
			int nx = x0 + d[i][0];
			int ny = y0 + d[i][1];
			if(nx >= 0 && nx < n && ny >= 0 && ny < m && a[nx][ny] != '#' && vis[nx][ny] != 1){
				q[tail].x = nx;
				q[tail].y = ny;
				q[tail].step = step + 1;
				tail++;
				vis[nx][ny] = 1;
			}
		}
		head++;
	}
	cout << "No" << endl;
}
int main(){
	cin >> n >> m;
	memset(vis , 0 , sizeof(vis));
	for(int i = 0 ; i < n ; i++){
		scanf("%s" , a[i]);
	}
	bfs(0 , 0 , n - 1 , m - 1);
	return 0;
}
